import React, { memo, useState } from 'react'
import { getImageUrl } from './util/getImageUrl'
import { Select } from 'antd'

const App = memo(() => {
  const [pictureSrc, setpictureSrc] = useState("alarm");
  const { Option } = Select;
  let items = ['图1', '图2']
  let SelectItems = [];
  for (let i of items) {
    SelectItems.push(<Option key={i} value={i}>{i}</Option>)
  }
  return (
    <div style={{ width: '200px', height: '200px' }}>
      <Select
        size='large'
        defaultValue={'图1'}
        style={{ width: '100%' }}
      // onChange={}
      >
        {SelectItems}
      </Select>
      <img src={getImageUrl(pictureSrc)} alt="" />
    </div>
  )
})

export default App